/* 
 * Copyright (C) 2015 Bruce Beisel
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "ForecastRule.h"

namespace vp2 {
const std::string ForecastRule::FORECAST[] = {
    "Mostly clear and cooler.",
    "Mostly clear with little temperature change.",
    "Mostly clear for 12 hours with little temperature change.",
    "Mostly clear for 12 to 24 hours and cooler.",
    "Mostly clear with little temperature change.",
    "Partly cloudy and cooler.",
    "Partly cloudy with little temperature change.",
    "Partly cloudy with little temperature change.",
    "Mostly clear and warmer.",
    "Partly cloudy with little temperature change.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 24 to 48 hours.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds with little temperature change. Precipitation possible within 24 hours.",
    "Mostly clear with little temperature change.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds with little temperature change. Precipitation possible within 12 hours.",
    "Mostly clear with little temperature change.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 24 hours.",
    "Mostly clear and warmer. Increasing winds.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 12 hours. Increasing winds.",
    "Mostly clear and warmer. Increasing winds.",
    "Increasing clouds and warmer.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 12 hours. Increasing winds.",
    "Mostly clear and warmer. Increasing winds.",
    "Increasing clouds and warmer.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 12 hours. Increasing winds.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly clear and warmer. Precipitation possible within 48 hours.",
    "Mostly clear and warmer.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds with little temperature change. Precipitation possible within 24 to 48 hours.",
    "Increasing clouds with little temperature change.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 12 to 24 hours.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 12 to 24 hours. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 12 to 24 hours. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 6 to 12 hours.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 6 to 12 hours. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 12 to 24 hours. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation possible within 12 hours.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and warmer. Precipitation likley.",
    "Clearing and cooler. Precipitation ending within 6 hours.",
    "Partly cloudy with little temperature change.",
    "Clearing and cooler. Precipitation ending within 6 hours.",
    "Mostly clear with little temperature change.",
    "Clearing and cooler. Precipitation ending within 6 hours.",
    "Partly cloudy and cooler.",
    "Partly cloudy with little temperature change.",
    "Mostly clear and cooler.",
    "Clearing and cooler. Precipitation ending within 6 hours.",
    "Mostly clear with little temperature change.",
    "Clearing and cooler. Precipitation ending within 6 hours.",
    "Mostly clear and cooler.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds with little temperature change. Precipitation possible within 24 hours.",
    "Mostly cloudy and cooler. Precipitation continuing.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation likely.",
    "Mostly cloudy with little temperature change. Precipitation continuing.",
    "Mostly cloudy with little temperature change. Precipitation likely.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and cooler. Precipitation possible and windy within 6 hours.",
    "Increasing clouds with little temperature change. Precipitation possible and windy within 6 hours.",
    "Mostly cloudy and cooler. Precipitation continuing. Increasing winds.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation likely. Increasing winds.",
    "Mostly cloudy with little temperature change. Precipitation continuing. Increasing winds.",
    "Mostly cloudy with little temperature change. Precipitation likely. Increasing winds.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and cooler. Precipitation possible within 12 to 24 hours possible wind shift to the W NW or N.",
    "Increasing clouds with little temperature change. Precipitation possible within 12 to 24 hours possible wind shift to the W NW or N.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and cooler. Precipitation possible within 6 hours possible wind shift to the W NW or N.",
    "Increasing clouds with little temperature change. Precipitation possible within 6 hours possible wind shift to the W NW or N.",
    "Mostly cloudy and cooler. Precipitation ending within 12 hours possible wind shift to the W NW or N.",
    "Mostly cloudy and cooler. Possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Precipitation ending within 12 hours possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Possible wind shift to the W NW or N.",
    "Mostly cloudy and cooler. Precipitation ending within 12 hours possible wind shift to the W NW or N.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation possible within 24 hours possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Precipitation ending within 12 hours possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Precipitation possible within 24 hours possible wind shift to the W NW or N.",
    "Clearing cooler and windy. Precipitation ending within 6 hours.",
    "Clearing cooler and windy.",
    "Mostly cloudy and cooler. Precipitation ending within 6 hours. Windy with possible wind shift to the W NW or N.",
    "Mostly cloudy and cooler. Windy with possible wind shift to the W NW or N.",
    "Clearing cooler and windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy with little temperature change. Precipitation possible within 12 hours. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and cooler. Precipitation possible within 12 hours possibly heavy at times. Windy.",
    "Mostly cloudy and cooler. Precipitation ending within 6 hours. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation possible within 12 hours. Windy.",
    "Mostly cloudy and cooler. Precipitation ending in 12 to 24 hours.",
    "Mostly cloudy and cooler.",
    "Mostly cloudy and cooler. Precipitation continuing possible heavy at times. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation possible within 6 to 12 hours. Windy.",
    "Mostly cloudy with little temperature change. Precipitation continuing possibly heavy at times. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy with little temperature change. Precipitation possible within 6 to 12 hours. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds with little temperature change. Precipitation possible within 12 hours possibly heavy at times. Windy.",
    "Mostly cloudy and cooler. Windy.",
    "Mostly cloudy and cooler. Precipitation continuing possibly heavy at times. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation likely possibly heavy at times. Windy.",
    "Mostly cloudy with little temperature change. Precipitation continuing possibly heavy at times. Windy.",
    "Mostly cloudy with little temperature change. Precipitation likely possibly heavy at times. Windy.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and cooler. Precipitation possible within 6 hours. Windy.",
    "Increasing clouds with little temperature change. Precipitation possible within 6 hours. Windy.",
    "Increasing clouds and cooler. Precipitation continuing. Windy with possible wind shift to the W NW or N.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation likely. Windy with possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Precipitation continuing. Windy with possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Precipitation likely. Windy with possible wind shift to the W NW or N.",
    "Increasing clouds and cooler. Precipitation possible within 6 hours. Windy with possible wind shift to the W NW or N.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and cooler. Precipitation possible within 6 hours possible wind shift to the W NW or N.",
    "Increasing clouds with little temperature change. Precipitation possible within 6 hours. Windy with possible wind shift to the W NW or N.",
    "Increasing clouds with little temperature change. Precipitation possible within 6 hours possible wind shift to the W NW or N.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and cooler. Precipitation possible within 6 hours. Windy with possible wind shift to the W NW or N.",
    "Increasing clouds with little temperature change. Precipitation possible within 6 hours. Windy with possible wind shift to the W NW or N.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Increasing clouds and cooler. Precipitation possible within 12 to 24 hours. Windy with possible wind shift to the W NW or N.",
    "Increasing clouds with little temperature change. Precipitation possible within 12 to 24 hours. Windy with possible wind shift to the W NW or N.",
    "Mostly cloudy and cooler. Precipitation possibly heavy at times and ending within 12 hours. Windy with possible wind shift to the W NW or N.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation possible within 6 to 12 hours possibly heavy at times. Windy with possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Precipitation ending within 12 hours. Windy with possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Precipitation possible within 6 to 12 hours possibly heavy at times. Windy with possible wind shift to the W NW or N.",
    "Mostly cloudy and cooler. Precipitation continuing.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation likely. Windy with possible wind shift to the W NW or N.",
    "Mostly cloudy with little temperature change. Precipitation continuing.",
    "Mostly cloudy with little temperature change. Precipitation likely.",
    "Partly cloudy with little temperature change.",
    "Mostly clear with little temperature change.",
    "Mostly cloudy and cooler. Precipitation possible within 12 hours possibly heavy at times. Windy.",
    "FORECAST REQUIRES 3 HOURS OF RECENT DATA."
};

static const std::string EMPTY_STRING = "";
const int ForecastRule::NUM_RULES = sizeof(FORECAST) / sizeof(FORECAST[0]);

ForecastRule::ForecastRule(int rule) : rule(rule) {
}

ForecastRule::~ForecastRule() {
}

int
ForecastRule::getRule() const {
    return rule;
}

const std::string &
ForecastRule::forecastString(int rule) {
    if (rule < 0 || rule >= NUM_RULES)
        return EMPTY_STRING;
    else
        return FORECAST[rule];
}
}